Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clean-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-webpack-plugin

A webpack plugin to remove your build folder(s) before building

  • 0.1.19
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is clean-webpack-plugin?

The clean-webpack-plugin is a plugin for webpack, a module bundler for JavaScript. It is used to remove/clean your build folder(s) before building. This ensures that only used files are generated when your project is built, preventing the accumulation of outdated files from previous builds.

What are clean-webpack-plugin's main functionalities?

Removing all files inside webpack's output.path directory

This feature automatically cleans up the output directory specified in webpack's configuration before each build, ensuring that only the files generated in the current build are present.

const { CleanWebpackPlugin } = require('clean-webpack-plugin');

module.exports = {
  plugins: [
    new CleanWebpackPlugin(),
  ],
};

Preserving specific files or directories during clean

This feature allows you to exclude specific files or directories from being deleted when the output directory is cleaned. This is useful for cases where you want to keep certain files across builds.

const { CleanWebpackPlugin } = require('clean-webpack-plugin');

module.exports = {
  plugins: [
    new CleanWebpackPlugin({
      cleanOnceBeforeBuildPatterns: ['**/*', '!static-files*'],
      cleanStaleWebpackAssets: false,
      protectWebpackAssets: false
    }),
  ],
};

Other packages similar to clean-webpack-plugin

Keywords

FAQs

Package last updated on 07 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc